//package org.huaiyan.oauth.uaa.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.core.io.ClassPathResource;
//import org.springframework.security.oauth2.provider.token.TokenStore;
//import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
//import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
//import org.springframework.security.oauth2.provider.token.store.KeyStoreKeyFactory;
//import org.springframework.security.oauth2.provider.token.store.jwk.JwkTokenStore;
//
//
///**
// * Created with IntelliJ IDEA 2020.3
// *
// * @author: huaiyan
// * Date: 2021-10-19 16:23
// * Description: 文件描述信息
// */
//@Configuration
//public class MyJwtConfig {
//
//
//    @Bean("jwtTokenStore")
//    @Primary
//    public TokenStore jwtTokenStore() {
//        return new JwtTokenStore(jwtAccessTokenConverter());
//    }
//
//    @Bean("jwtAccessTokenConverter")
//    public JwtAccessTokenConverter jwtAccessTokenConverter() {
////        JwtAccessTokenConverter tokenConverter = new UserJwtAccessTokenConverter();
////        tokenConverter.setKeyPair(keyStoreKeyFactory.getKeyPair("eimc-jwt"));
////        读取私钥,放进令牌中
////        KeyStoreKeyFactory keyStoreKeyFactory = new KeyStoreKeyFactory(new ClassPathResource("eimc-jwt.jks"), "passw0rd".toCharArray());
//
//        JwtAccessTokenConverter tokenConverter = new JwtAccessTokenConverter();
//        ///需要设置jwt的秘钥
//        tokenConverter.setSigningKey("HUAI-YAN");
//        return tokenConverter;
//
//    }
//
//
//}
